/* Copyright (C) 2010 Luca Piccinelli
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/* 
 * File:   CvHysteresisThreshOp.h
 * Author: picci
 *
 * Created on January 15, 2011, 1:17 PM
 */

#ifndef CVHYSTERESISTHRESHOP_H
#define	CVHYSTERESISTHRESHOP_H

#include <opencv2/core/core.hpp>
#include <opencv2/core/mat.hpp>

#include <list>

#include "gestface.h"
#include "pipeline/pipeline_data_structures.h"

namespace NAMESPACE{

// ****** Functor definition ***************************************************
class CvHysteresisThreshFunc{
public:
    bool operator()(const cv::Mat& src,
                    cv::Mat& dst,
                    uchar t1,
                    uchar t2,
                    uchar v1,
                    uchar v2,
                    int block_size);
};
// -----------------------------------------------------------------------------

class CvHysteresisThreshOp : public AbstractOperation<CvHysteresisThreshFunc>{
public:
    static const size_t MIN_INPUT_NUM;
    static const size_t MIN_CRITERIA_NUM;
    static const size_t MIN_OUTPUT_NUM;

private:
    IOKey k1, k2, k3, k4, k5, k6, k7;

public:
    ~CvHysteresisThreshOp();
    CvHysteresisThreshOp();
    CvHysteresisThreshOp(const CvHysteresisThreshOp& sfo);
    CvHysteresisThreshOp& operator=(const CvHysteresisThreshOp& sfo);

    virtual bool doOperation(const std::list<input_t>& inputs,
                             const std::list<criteria_t>& operationCriteria,
                             std::list<output_t>& outputs) throw(bad_io_mapping) ;

    bool operator==(const AbstractOperation<operation_t>& op) const;
    bool operator!=(const AbstractOperation<operation_t>& op) const;
};

}

#endif	/* CVHYSTERESISTHRESHOP_H */

